#ifndef MENUDIALOG_H
#define MENUDIALOG_H

#include <QtGui/QDialog>

namespace Ui {
    class MenuDialog;
}

class QModelIndex;
class QAction;

class MenuModel;
class MenuDialog: public QDialog {
    Q_OBJECT
public:
    MenuDialog(QWidget *parent = 0);
    ~MenuDialog();

public:
    void addActionItem(QAction* action);
    void addActionItem(const QString& label, QObject* receiver, const char* method);
    void addSettingsItem(const QString& label, const QString& settingKey);
//    void addSettingsItem(const QString& label, const QString& settingKey,
//                         const QMap<QString,QVariant>& items);

protected:
    void changeEvent(QEvent *e);
    void keyPressEvent(QKeyEvent* event);

public slots:
    void setup();
    void triggerAction(const QModelIndex& index);

private:
    Ui::MenuDialog *ui;
    MenuModel* model;
};

#endif // MENUDIALOG_H
